package com.fire.web.modules.all.controller;

import com.fire.web.modules.all.constant.ErrorCodeConstants;
import com.fire.web.modules.all.entity.*;
import com.fire.web.modules.all.service.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
public class MapController {
	private static final Logger LOGGER = LoggerFactory.getLogger(MapController.class);
	@Autowired
	ITMitServiceDicBaseService dicBaseService;

	/**
	 * 获取百度地图ak
	 *
	 * @return
	 * @author zengzhengfu
	 */
	@GetMapping(value = "/getAk")
	@ResponseBody
	public AjaxResult getAk() {
		LOGGER.info("=====================================开始获取百度地图AK=====================================");
		TMitServiceDicBase ak = dicBaseService.selectById("BAIDUAK");
		String akvalue = ak.getBvalue();
		LOGGER.info("获取AK：" + akvalue);
		LOGGER.info("=====================================获取百度地图AK结束=====================================");
		return new AjaxResult(ErrorCodeConstants.SUCCESS, "获取成功", akvalue, "获取成功");
	}

}
